package com.easy.thread;

import java.util.concurrent.CountDownLatch;

/**
 * @Packge com.easy.thread
 * @Autor linNaibin
 * @Description
 * @Version 1.0
 * @Date 2021/1/12 16:39
 */
public class EasyRunnable implements Runnable {

    private String name;
    private CountDownLatch latch;

    public EasyRunnable(String name, CountDownLatch latch) {
        this.name = name;
        this.latch = latch;
    }

    @Override
    public void run() {
        System.out.println("thread :" + Thread.currentThread().getName() + ",exe :" + name);
        latch.countDown();
    }
}
